#!/usr/bin/env bash
SMAC_MEMORY_INPUT=$SMAC_MEMORY
SMACMEM=1024
test "$SMAC_MEMORY_INPUT" -ge 1 2>&- && SMACMEM=$SMAC_MEMORY_INPUT
EXEC=ca.ubc.cs.beta.smac.executors.SMACExecutor
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ ! -d "$DIR/lib" ]; then
DIR="$(dirname "$DIR")"
fi
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DIR/lib/native/:$DIR/lib/:$DIR/
DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:$DIR/lib/native/:$DIR/lib/:$DIR/

exec java -Xmx"$SMACMEM"m -cp "$DIR/conf/:$DIR/patches/:$DIR/*:$DIR/lib/*:$DIR/patches/" ca.ubc.cs.beta.aeatk.ant.execscript.Launcher $EXEC "$@"
